package com.java.comprehensive.design.behavioral_model.iterator_pattern;

public class Client {
    public static void main(String[] args) {
        StudentAggregateImpl studentAggregate = new StudentAggregateImpl();
        studentAggregate.add(new Student("tom", 12));
        studentAggregate.add(new Student("jack", 12));
        studentAggregate.add(new Student("jame", 12));
        StudentIterator iterator = studentAggregate.iterator();
        while (iterator.hasNext()) {
            System.out.println(iterator.next());
        }

    }
}
